Skip to main content

All Questions

2votes
0answers
105views

Ruby OOP Mastermind Game Code Refactor

I have finished The mastermind game. Basically, it's a game that has 2 sides, codebreaker or codemaker. If you are a codebreaker, you are guessing the colour code that the computer has chosen. If you ...
theplaceofburak's user avatar
4votes
2answers
141views

Ruby CLI TicTacToe

I have done Tictactoe game in Ruby. It is my first Object Oriented project in Ruby. I would like to separate all program into a few classes such as Player Board and Game. I want to use more OOP best ...
theplaceofburak's user avatar
1vote
2answers
255views

Refactoring Ruby recharge REST API wrapper by using class variables

I am trying to create an API wrapper for recharge (A Shopify subscription service), I am using the HTTParty gem ...
Artyrcheek's user avatar
3votes
1answer
232views

Singleton in Ruby without using Singleton module or class variable

When I need a singleton class in my Ruby code (for example, single logger for multiple classes) I usually use code like this: ...
Ivan Olshansky's user avatar
1vote
1answer
728views

Ruby Tic-Tac-Toe two-player

As a preface, I'm very new to coding (self-learning) so if you notice any bad habits please let me know, it would be GREATLY appreciated. I'm self-learning Ruby so I don't really have a frame of ...
mbcode's user avatar
2votes
1answer
71views

Change architecture of Ruby app to be more object oriented, readable

I'm working on a Slack bot for service desk which sends direct message to user on a Slack when their ticket will be on user_action_needed status. I'm using AWS ...
mr_muscle's user avatar
2votes
2answers
379views

Rock, Paper, Scissors completed game

I have just completed my first Ruby OOP project. Fairly simple but still a bit time consuming as I am still learning the language. I would like feedback and ways I can improve on this and make the ...
nimpa's user avatar
4votes
2answers
918views

Ruby price calculator for groceries

I am good at logic and most of the time I write working code. But I want to learn writing code which follows best practices and is very efficient. I tried to implement some of them in my code but it ...
Praneetha's user avatar
2votes
1answer
74views

Table class to fill array structure with values

The code creates a table and adds rows and columns. Does it make sense to write the code like this? Would you design it differently? Is there a better OOP approach to this? ...
Christian's user avatar
2votes
2answers
332views

github page/ DHH Score Challenge in ruby

I wrote the following code which when executed prints the score of https://github.com/dhh. ...
Praneetha's user avatar
15votes
1answer
509views

Ruby chess engine gem

This is my first Ruby gem that claims to provide all the rules of the chess game. My goal was to keep this library as simple as possible via OOP principles, and I'd be glad to hear any feedback from ...
Anikeev Gennadiy's user avatar
5votes
1answer
57views

Scheduled file sorting with Ruby

I have a script running as an hourly cron job. It finds all screenshots on the Desktop and moves them to directories sorted by year/month/day. On MacOS, screenshots are automatically saved to the ...
nope's user avatar
2votes
1answer
73views

Use of inheritance using two Ruby libraries

Currently I'm working on parsing data from a form service into a pdf form. I created 2 classes one inheriting from the other one. However, I see that the classes I created are growing in lines of ...
Steven Aguilar's user avatar
2votes
2answers
201views

Modelling football teams and fixtures in Ruby (as compared to SQL)

I am trying to model information around football teams and fixtures. I am using the Premier League fantasy football API for my data. The fixtures API is here, and the team data (along with a lot of ...
WelshGandalf's user avatar
3votes
1answer
234views

A Ruby script to generate random "people"

I'm working on developing a small Ruby program to generate random data for a Neo4J database, including people, addresses, phone numbers, etc. I'm a total beginner to Ruby, so I wanted to post my ...
PythonNewb's user avatar

153050per page
close